<!DOCTYPE html>
<html lang="en">
<head>
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="yes" name="apple-touch-fullscreen">
    <meta content="telephone=no,email=no" name="format-detection">
    <meta name="wap-font-scale" content="no">
    <meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title><?=$title?></title>
    <link rel="stylesheet" href="/mobile/css/reset.css">
    <link rel="stylesheet" href="/mobile/css/mui.min.css">
    <script src="/mobile/js/flexible_css.debug.js"></script>
    <script src="/mobile/js/flexible.debug.js"></script>
    <link rel="stylesheet" href="/mobile/css/main_train.css">
</head>
<body>
<div id="back-btn-wrap">
    <a class="back-btn" href="javascript:history.go(-1)"></a>试卷预览
    <a class="add-btn" href="javascript:void(0);">添加题目</a>
</div>
<div v-cloak class="content-main preview-wrap">
    <div class="title">
        题目
    </div>
    <!--如果有题目start-->
    <?php foreach($preview as $k=>$v):?>
        <section class="questions-wrap choose-wrap">
        <div class="questions-item clearfix" data-type="'+question_arr[k].type+'">
            <div><span class="num-now-wrap fl"><?=$k+1?>、</span></div><p class="question">(<?php if($v['type'] == 1):?>单选题<?php elseif($v['type'] == 2):?>多选题<?php endif;?>)<?=$v['topic']?><a href="edit?qid=<?=$v['qid']?>&llid=<?=$v['llid']?>">编辑题目</a></p>
        </div>
        <?php $correct = explode(',',$v['correct'])?>
        <?php if($v['type'] == 1):?>
            <div class="option-item clearfix <?php if($correct[0] == 1):?>active<?php endif;?>" style="">
                <span class="<?php if($correct[0] == 1):?>active<?php endif;?>">A</span><p class="option-text"><?=$v['option_a']?></p>
            </div>
            <div class="option-item clearfix <?php if($correct[0] == 2):?>active<?php endif;?>">
                <span class="<?php if($correct[0] == 2):?>active<?php endif;?>">B</span><p class="option-text"><?=$v['option_b']?></p>
            </div>
            <div class="option-item clearfix <?php if($correct[0] == 3):?>active<?php endif;?>">
                <span class="<?php if($correct[0] == 3):?>active<?php endif;?>">C</span><p class="option-text"><?=$v['option_c']?></p>
            </div>
            <div class="option-item clearfix <?php if($correct[0] == 4):?>active<?php endif;?>">
                <span class="<?php if($correct[0] == 4):?>active<?php endif;?>">D</span><p class="option-text"><?=$v['option_d']?></p>
            </div>
        <?php elseif($v['type'] == 2):?>
            <div class="option-item clearfix <?php if($correct[0] == 1):?>active<?php endif;?>" style="">
                <span class="<?php if($correct[0] == 1):?>active<?php endif;?>">A</span><p class="option-text"><?=$v['option_a']?></p>
            </div>
            <div class="option-item clearfix <?php if($correct[0] == 2 || $correct[1] == 2):?>active<?php endif;?>">
                <span class="<?php if($correct[0] == 2 || $correct[1] == 2):?>active<?php endif;?>">B</span><p class="option-text"><?=$v['option_b']?></p>
            </div>
            <div class="option-item clearfix <?php if($correct[0] == 3 || $correct[1] == 3 || $correct[2] == 3):?>active<?php endif;?>">
                <span class="<?php if($correct[0] == 3 || $correct[1] == 3 || $correct[2] == 3):?>active<?php endif;?>">C</span><p class="option-text"><?=$v['option_c']?></p>
            </div>
            <div class="option-item clearfix <?php if($correct[0] == 4 || $correct[1] == 4 || $correct[2] == 4 || $correct[3] == 4):?>active<?php endif;?>">
                <span class="<?php if($correct[0] == 4 || $correct[1] == 4 || $correct[2] == 4 || $correct[3] == 4):?>active<?php endif;?>">D</span><p class="option-text"><?=$v['option_d']?></p>
            </div>
        <?php endif;?>
        </section>
    <?php endforeach;?>
    <!--如果有题目end-->


</div>

<script src="/mobile/js/jquery.min.js"></script>
<script src="/mobile/js/common.js"></script>
<script src="/mobile/js/mui.min.js"></script>
<script src="/index/js/jrrpc.js"></script>
<script src="/mobile/js/autosize.js"></script>
<script src="/mobile/js/jQueryValidate/jquery.validate.min.js"></script>
<script src="/mobile/js/jQueryValidate/jquery.validate.method.js"></script>

<script>
    function exitEdit(e){
        e.preventDefault();
        location.href = '/Prior/my';
    }
</script>
<script>
    $(function(){
        mui.init();
        var llid = iService.getQueryString('llid');
        $('.add-btn').on('click',function(){
            window.location.href = '/question/add?llid='+llid+'&channelType=1';
        });

        $(".back-btn").on('click',exitEdit);

        $.each($(".option-item span"),function(){
            var height_cur = $(this).parent('.option-item').height();
            $(this).height(height_cur);
            $(this).css('line-height',height_cur+'px');
        });
    });
</script>
</body>
</html>












